package com.test.gui;



import acm.graphics.GRect;
import acm.program.GraphicsProgram;

public class CheckBoard extends GraphicsProgram {
	/* number of row */
	private static final int NROWS = 8;
	/*number of columns*/
	private static final int NCOLUMNS =8;
	@Override
	public void run() {
		int sqSize = getHeight()/NROWS;
		for (int i = 0; i < NROWS; i++) {
			for (int j = 0; j < NCOLUMNS; j++) {
				int x = j*sqSize;
				int y = i*sqSize;
				GRect sq = new GRect(x, y, sqSize, sqSize);
				sq.setFilled(((i+j)%2)!=0);
				add(sq);
			}
		}
	}

}
